package com.etc.core.pojo;

public class CodeMessage {
    private String code;
    private String message;
    private Object data;

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public Object getData() {
        return data;
    }

    public void setData(Object data) {
        this.data = data;
    }

    public static CodeMessage success() {
        return new CodeMessage("200");
    }
    public static CodeMessage success(Object data) {
        CodeMessage cm =  new CodeMessage("200");
        cm.setData(data);
        return cm;
    }
    public CodeMessage() {
    }

    public CodeMessage(String code, String message, Object data) {
        this.code = code;
        this.message = message;
        this.data = data;
    }

    public CodeMessage(String code, String message) {
        this.code = code;
        this.message = message;
        this.data = data;
    }
    public CodeMessage(String code) {
        this.code = code;
    }


    public static CodeMessage fail(String message) {
        return new CodeMessage("201", message);
    }

}
